/*
 * @Description:
 * @Autor: GuluGuluu
 * @Date: 2023-06-24 14:11:04
 * @LastEditors: GuluGuluu
 * @LastEditTime: 2023-06-24 14:11:13
 */
import { NavLink } from "react-router-dom";
function MyNavLink(props) {
  // 分别是类名，active类名，路径和文字
  const { className, active, path, text, title, icon } = props;
  return (
    <NavLink
      className={({ isActive }) => className + (isActive ? ` ${active}` : "")}
      title={title}
      to={path}
      tabIndex={0}
    >
      {icon}
      {text}
    </NavLink>
  );
}
MyNavLink.defaultProps = { icon: null };
export default MyNavLink;
